package com.bosssoft.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.bosssoft.entity.po.FibAuthPO;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 * @author Li kexi
 * Created on 2021/8/16.14:32
 */
public interface FibAuthMapper extends BaseMapper<FibAuthPO> {

    /**
     * 通过id禁用权限
     * @param authId
     * @return
     */
    @Update("UPDATE fib_auth \n" +
            "SET deleted = #{status} \n" +
            "WHERE auth_id = #{authId}")
    int banAuthById(Long authId, Integer status);

    @Select("SELECT url \n" +
            "FROM fib_auth \n" +
            "WHERE auth_id = #{id} ")
    String getUrlById(Long id);

    int updateBatch(List<FibAuthPO> list);

    int updateBatchSelective(List<FibAuthPO> list);

    int batchInsert(@Param("list") List<FibAuthPO> list);

    int insertOrUpdate(FibAuthPO record);

    int insertOrUpdateSelective(FibAuthPO record);
}